#{extends 'main.html' /}
#{set title: 'page.app.home.title' /}

<div id="content">
#{ifnot infoRequest?.id}
	<h3>New information request for the focus: ${focus.title}</h3>
#{/ifnot}
#{else}
	<h3>Edit the information request for the focus: ${focus.title}</h3>
#{/else}

#{ifErrors}
<p class="error">
Please correct these errors.
</p>
#{/ifErrors}

<script src="@{'/public/jquery-ui/datetimepicker/jquery.ui.datetimepicker.min.js'}" type="text/javascript" charset="${_response_encoding}"></script>
<link href="@{'/public/jquery-ui/datetimepicker/jquery.ui.datetimepicker.css'}" rel="stylesheet" type="text/css" />

<script type="text/javascript">
	$(document).ready(function() {
		var lang = '${play.i18n.Lang.get()}';
		$("#infoRequest_start").datetimepicker({dateFormat: 'yyyy/mm/dd HH:MM:ss'});
		$("#infoRequest_end").datetimepicker({dateFormat: 'yyyy/mm/dd HH:MM:ss'});
	});
</script>


#{form @bluehat.InformationRequestController.save(focus.id), method:'POST', id:'infoRequestForm'}
#{field 'infoRequest.id'}
  <input  type="hidden" id="${field.id}" name="${field.name}" value="${infoRequest?.id}" class="${field.errorClass}">
#{/}
#{field 'infoRequest.description'}
<p>
  <label for="${field.id}">&{field.name}</label>
  <textarea id="${field.id}" name="${field.name}" cols="10" rows="3" class="${field.errorClass}">${infoRequest?.description}</textarea>
  <span class="error">${field.error}</span>
</p>
#{/}
#{field 'infoRequest.start'}
<p>
  <label for="${field.id}">&{field.name}</label>
  <input type="text" id="${field.id}" name="${field.name}" value="${infoRequest?.start?.format('yyyy/MM/dd HH:mm:ss')}" class="${field.errorClass}">
  <span class="error">${field.error}</span>
</p>
#{/}
#{field 'infoRequest.end'}
<p>
  <label for="${field.id}">&{field.name}</label>
  <input type="text" id="${field.id}" name="${field.name}" value="${infoRequest?.end?.format('yyyy/MM/dd HH:mm:ss')}" class="${field.errorClass}">
  <span class="error">${field.error}</span>
</p>
#{/}
<input type="submit"></input>
#{/form}
<a href="@{bluehat.FocusController.detail(focus.id)}">Volver al detalle del foco</a>
</div>
